$(document).ready(function () {
	$('#login_btn').on('click', function (e) {
		var username = $('#username').val();
		var pwd = $('#pwd').val();
		if (username === '' || pwd === '') {
			$('#login_failed').modal({});
			return false;
		} else {
			var userInfo = JSON.parse(localStorage.getItem('userinfo')) || [];
			var loginCheck = userInfo.some(function (v) {
				return v.username === username && v.pwd === pwd;
			});
			if(loginCheck){
				//mock
				setTimeout(function () {
					location.href='index.html';
				}, 0);
			}else{
				$('#login_failed').modal({});
				return false;
			}
		}
	});
});